<%@page import="com.mysql.fabric.xmlrpc.base.Data"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="leagal_aid.bean.*,java.util.*,java.io.*" %>
<%
request.setCharacterEncoding("utf-8");
String name = request.getParameter("name");
String  telephone = request.getParameter("telephone");
String  email = request.getParameter("email");
String  content = request.getParameter("message");
String  category = request.getParameter("category");
String  time = request.getParameter("txtDate");

MessageBean messageBean = new MessageBean();

if(messageBean.doAdd(name,telephone,email,content,category,time)){
	response.setCharacterEncoding("utf-8");
	PrintWriter pout = response.getWriter();
	pout.print("<script>alert('留言成功'); window.location='../message.jsp' </script>");
	pout.flush();
	pout.close();
}else{
	response.setCharacterEncoding("utf-8");
	PrintWriter pout = response.getWriter();
	pout.print("<script>alert('错误'); window.location='../message.jsp' </script>");
	pout.flush();
	pout.close();
	//response.sendRedirect("login.html");
};
%>    